*Sintax LIFESTILES File ITA2013 SAV weighted with weight.


********************************Cultural consumption.
freq d82_1 d82_2 d82_3 d82_4 d82_5 d82_6.
RECODE d82_1 d82_2 d82_3 d82_4 d82_5 d82_6 (2=0) (1=1) into d82_1r d82_2r d82_3r d82_4r d82_5r d82_6r.
freq d82_1r d82_2r d82_3r d82_4r d82_5r d82_6r.
COMPUTE cons_cult=d82_1r + d82_2r + d82_3r + d82_4r + d82_5r + d82_6r.
freq cons_cult.

****************************Material consumption.
freq d83_1 d83_2 d83_3 d83_4 d83_5 d83_6 d83_7 d83_8 d83_9 d83_10 d83_11 d83_12.
RECODE d83_1 d83_2 d83_3 d83_4 d83_5 d83_6 d83_7 d83_8 d83_9 d83_10 d83_11 d83_12 
(1=4) (2=3) (3=2) (4=1) 
INTO d83_1r d83_2r d83_3r d83_4r d83_5r d83_6r d83_7r d83_8r d83_9r d83_10r d83_11r d83_12r.
val lab d83_1r d83_2r d83_3r d83_4r d83_5r d83_6r d83_7r d83_8r d83_9r d83_10r d83_11r d83_12r 
1"Decisam falso" 2"Abb falso" 3"Abb vero" 4"Proprio vero".
Freq d83_1r d83_2r d83_3r d83_4r d83_5r d83_6r d83_7r d83_8r d83_9r d83_10r d83_11r d83_12r.

*FACTOR
  /VARIABLES d83_1r d83_2r d83_3r d83_4r d83_5r d83_6r d83_7r d83_8r d83_9r d83_10r d83_11r d83_12r
  /MISSING LISTWISE 
  /ANALYSIS d83_1r d83_2r d83_3r d83_4r d83_5r d83_6r d83_7r d83_8r d83_9r d83_10r d83_11r d83_12r
  /PRINT UNIVARIATE INITIAL EXTRACTION ROTATION
  /FORMAT BLANK (.20)
  /CRITERIA MINEIGEN(1) ITERATE(25)
  /EXTRACTION PC
  /CRITERIA ITERATE(25)
  /ROTATION VARIMAX
  /METHOD=CORRELATION.


*****Factors construction.
COMPUTE fid_marca=MEAN.3(d83_2r,d83_5r,d83_6r,d83_12r).
COMPUTE consumerismo=MEAN.3(d83_3r,d83_4r,d83_7r,d83_8r).
COMPUTE cons_diverti=MEAN.3(d83_9r,d83_10r,d83_11r,d83_1r).
freq  fid_marca consumerismo cons_diverti.


*******Coalition vote.
freq d90.
RECODE d90 (2,3,6,7,23=1) (8,9,11=2) (12,13,16,17,19=3) (5=4) 
(1, 4, 10, 14, 15, 20, 21, 22, 25=5)  (-1, 26, 27=6) INTO votocoa.
val lab votocoa 1"Centro-sinistra" 2"Centro" 3"Centro-destra" 4"M5s" 5"Altro" 6"NR".
freq votocoa.

*******Dining out.
freq d85.
recode d85 (1=5)(2=4)(3=3)(4=2)(5=1) into cena_f.
var lab cena_f "Cena fuori casa".
val lab cena_f 1"Mai" 2"Qualche v. anno" 3"Una pi� v. mese" 4"Una v. sett" 5"Pi� v. sett".
freq d85 cena_f.

*******Media consumption.
freq d85 d64 d62 d59.
mis val d59 d62 d64 (10).
fre d59 d62 d64.

*******RECODE.
mis val titrif classe (99).

recode profes13 (1=1)(2=2)(3=3)(5,10=4)(6,7=5)(11,12=6)(8=7)(9=8)(13=9)(4=10) into profes10.
val lab profes10 1"Pens" 2"Casal" 3"Stud" 4"Dir Impr LibP" 5"Imp conc Ins" 6"Lav aut"
7"Imp esec" 8"Operaio" 9"Atipici" 10"Disoc".
freq profes10.

freq cam7.
recode cam7 (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(16, 17, 18, 19=8)(97,98,99=99) into cam8.
val lab cam8 
1"Rc" 
2"Sel" 
3"Pd" 
4"M5S" 
5"Scelta civica" 
6"Pdl" 
7"Lega" 
8"Altri"
99"NR".
freq cam8.

************Compute normalized variables.
freq d59 d64 cons_cult fid_marca consumerismo cons_diverti cena_f .

compute ntv=(d59-1)/8.
freq d59 ntv.
compute ngior=(d64-1)/8.
freq d64 ngior.
compute ncult=cons_cult/6.
freq cons_cult ncult.
compute nmarc=(fid_marca-1)/3.
freq fid_marca nmarc.
compute ncons=(consumerismo-1)/3.
freq consumerismo ncons.
compute ndive=(cons_diverti-1)/3.
freq cons_diverti ndive.
compute ncena=(cena_f-1)/4.
freq cena_f ncena.

************Compute cluster variavbles.
*Cluster k.-means(4 cluster without radio).
*Kmeans with normalized variables.

QUICK CLUSTER ntv ngior ncult nmarc ncons ndive ncena
  /MISSING=LISTWISE
  /CRITERIA=CLUSTER(4) MXITER(50) CONVERGE(0)
  /METHOD=KMEANS(NOUPDATE)
  /SAVE CLUSTER(nclspss_4)
  /PRINT INITIAL ANOVA.

freq nclspss_4.
var lab nclspss_4 "Cluster a 4".
val lab nclspss_4 1"Critico sobrio" 2"Passivo-alienato" 3"Edonista" 4"Critico sofisticato".
freq nclspss_4.

rename vars nclspss_4=cluster.
freq cluster.

*****Education.
recode stu (1,2=5)(3=8)(4=10)(5 thru 8=13)(9,10=18) into annistu.
freq stu annistu.

******Participation.
RECODE d21_1 d21_2 d21_3 d21_4 d21_5 d21_6 d21_7 d21_8 (1=1) (2=0) (3=0) (4=0) INTO d21_1r d21_2r 
    d21_3r d21_4r d21_5r d21_6r d21_7r d21_8r.
COMPUTE partecip=d21_1r + d21_2r + d21_3r + d21_4r + d21_5r + d21_6r + d21_7r + d21_8r.
freq partecip.
compute npartec= partecip/8.
freq npartec.

******Involvement.
freq d27 d28.
mis val d27(5,6) d28(6).
compute d27r=5-d27.
compute nd27r=(d27r-1)/3.
compute nd28=(d28-1)/4.
freq nd27r nd28.
compute ncoin=mean(nd27r,nd28).
fre ncoin.

*****Left-right.
freq d39.
compute sindes10=d39.
mis val sindes10 (11,12,13).
val lab sindes10 1"Sinistra" 10"Destra".
freq sindes10.
recode d39 (1,2=1)(3,4=2)(5,6=3)(7,8=4)(9,10=5)(11,12,13=9) into sindes5.
val lab sindes5 1"Sin" 2"Censin" 3"Cen" 4"Cendes" 5"Des" 9"NR".
freq sindes5.

*****Political knowledge.
freq d95 d96 d97.
recode d95 d96 (1=1)(else=0) into d95r d96r.
recode d97(1=1)(2=.5)(else=0) into d97r.
freq d95r d96r d97r.
compute conosce=mean(d95r,d96r,d97r).
freq conosce.

******Class.
recode classe (5=4).
compute votocoa4=votocoa.
mis val votocoa4 (5,6).
fre classe votocoa votocoa4.
val lab classe 1"Borghesia" 2"Classe med impegat" 3"Piccola borgh" 4"Sobordinati (ope, imp esec, atip)".
freq votocoa4 classe.

*****Employement sector.
freq sett settp.
compute pub=0.
if ((sett=1) or (sett=3) or (settp=1) or (settp=3)) pub=1.
var lab pub "settore d'impiego x lavoro proprio o prec non c'� info x capofamiglia".
val lab pub 1"Pubblico" 0"Privato".
freq pub.


